package com.app;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.util.StringUtils;

import java.net.InetAddress;


@EnableScheduling
@SpringBootApplication
@ServletComponentScan(basePackages ="com.app.conf.SqlInjectFilter")
@MapperScan("com.app.mapper")
public class ProjectApplication {

	public static void main(String[] args) throws Exception{
//        SpringApplication.run(ProjectApplication.class, args);

		ConfigurableApplicationContext application = SpringApplication.run(ProjectApplication.class, args);
		Environment env = application.getEnvironment();
		String ip = InetAddress.getLocalHost().getHostAddress();
		String port = env.getProperty("server.port");
		String path = env.getProperty("server.servlet.context-path");
		System.err.println("\n\t" +"External访问网址: \thttp://" + ip + ":" + port + path);
		System.err.println("\n\t" +"肃州区廉租房 项目启动成功！");
		System.err.println("\n\t" +"swagger3访问路径：http://"+ip+":"+port+path+"/doc.html#/home");
	}
}
